Java 11 Interview Questions and Answers
Related differences
Ques 16. What is Unicode 10 in Java 11?
It supports the latest Unicode version, particularly in the classes below:
- Character and String in the java.lang package
- NumericShaper in the java.awt.font package
- Bidi, BreakIterator, and Normalizer in the java.text package
Ques 17. What is Flight Recorder in Java 11?
Java Flight Recorder (JFR) is a profiling tool that collects data about events during the execution of a Java application in Java Virtual Machine (JVM). JFR is integrated into the JVM and part of the JDK distribution.
- Using Command Line: Compile FlightRecTest Java program by executing the below command, which will generate FlightRecTest.class file at src/com/withoutbook/flightrecorder location.
Once compilation is successful, the following options can be taken to start the program:javac -d out -sourcepath src/com/withoutbook/flightrecorder/FlightRecTest.java
java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=200s,filename=recording.jfr -cp ./out/ com.withoutbook.flightrecorder.FlightRecTest
- Using Diagnostic Command: The jcmd tool also allows registration of events to start. To start a 70-second recording on the running Java process with the identifier 4532 and save it to recording.jfr in the current directory, use the following:
Below commands relevant to Java Flight Recorder are:jcmd 4532 JFR.start duration=70s filename=recording.jfr
//Start a recording.JFR.start//It check the status of all recordings running for the specified process, including the recording file name, identification number, duration.JFR.check//It stop recording with a specific identification number, by default, recording 1 is stopped.JFR.stop//It dump the data collected by the recording with a specific identification number, by default, data from recording 1 is dumped.JFR.dump
Ques 18. What are ChaCha20 and Poly1305 Cryptographic Algorithms in Java 11?
Java 11 has Implement the ChaCha20 and ChaCha20-Poly1305 ciphers.
ChaCha20 is a new stream cipher which replaces the older, insecure RC4 stream cipher.
Poly1305 is a cryptographic Message Authentication Code (MAC), used on both Encrypted and Decrypted messages, it creates the authentication token and guarantees the integrity of the message.
In ChaCha20-Poly1305 algorithm, ChaCha20 Stream cipher performs the Encryption and Poly1305 performs the Authentication. The ChaCha20 and ChaCha20-Poly1305 algorithms will implement the javax.crypto.CipherSpi API within the SunJCE provider.
Ques 19. What is Launch Single-File Source-Code Programs in Java 11?
It enhances the Java launcher to run the program provided as a single Java source code file, including the use of "shebang" files and related techniques from within the script.
Ques 20. What is Low-Overhead Heap Profiling in Java 11?
It provides a way to get information from the JVM about Java object heap allocations that:
- Is low-overhead enough to be enabled by default continuously
- Is accessible via a well-defined, programmatic interface
- Sample all allocations (which is not limited to allocations that are in one particular heap region or that were allocated in one particular way)
- It can be defined in an implementation-independent way (i.e., without relying on any particular GC algorithm or VM implementation)
- It provide information about both live and dead Java objects.
Most helpful rated by users:
- What is Java 11?
- What is Local-Variable Syntax for Lambda Parameters in Java 11?
- What is Java Mission Control in Java 11?
- What is the difference between Oracle JDK and OpenJDK?